package com.wsoft.hr.pm.manager;

import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wsoft.hr.pm.entity.sys.HrMemberOrgRelationEntity;
import com.wsoft.hr.pm.mapper.HrMemberOrgRelationMapper;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author z001
 * @Date 2025/3/8 11:29
 */
@Service
public class HrMemberOrgRelationManager extends ServiceImpl<HrMemberOrgRelationMapper, HrMemberOrgRelationEntity> {


    /**
     * 根据用户id查询
     * @param memberIds
     * @return
     */
    public List<HrMemberOrgRelationEntity> getByMemberIsd(List<Long> memberIds){
        if(CollUtil.isEmpty(memberIds)){
            return new ArrayList<>();
        }
        QueryWrapper<HrMemberOrgRelationEntity> query = new QueryWrapper<>();
        query.lambda().in(HrMemberOrgRelationEntity::getMemberId,memberIds);
        return super.list(query);
    }
}
